import axios from './axios'
import qs from 'qs'

// 登录接口
export function token (data) {
  const param =qs.stringify({
    ...data,
  })
  // return axios({
  //   url: '/api-er/orgMember/auth/login',
  //   method: 'post',
  //   param
  //   // data: param
  //   // data: {username ,password}
  // })
  return axios.post(`/api-er/orgMember/auth/login?${param}`)
}

// 退出登录
export function logout (data) {
  return axios.post('/api-auth/oauth/remove/token', data)
}

export function userInfo (data) {
  return axios.get('/api-auth/oauth/userinfo', data)
}

export function menu (data) {
  return axios.get('/api-user/menus/current', data)
}

export function selectAll () {
  return axios.get('/api-visit/configuration/selectAll')
}

export function upload (data) {
  return axios.post('/api-file/files-anon', data)
}

// 获取验证码
export function getCode (data) {
  return axios.get('/api-taxi/sms/code', data)
}

// 校验验证码
export function checkCode (data) {
  return axios.post('/api-taxi/sms/validate', data)
}

// 修改密码
export function updatePassword (data) {
  const param =qs.stringify({
    ...data,
  })
  return axios.post(`/api-er/orgMember/auth/updatePassword?${param}`)
}
